﻿using AutoMapper;
using Modules;
using Modules.Attachment;
using Modules.Project;
using PmSoft;
using System.ComponentModel.DataAnnotations;

namespace ManagementApi.Models.Project;

/// <summary>
/// 保证金账户编辑表单
/// </summary>
public class ProjectGuaranteePaymentEditForm
{
    /// <summary>
    ///
    ///</summary>
    public int? Id { get; set; }

    /// <summary>
    /// 关联保证金账户Id
    ///</summary>
    [Display(Name = "保证金账户")]
    public int? GuaranteeAccountId { get; set; }

    /// <summary>
    /// 缴纳主体名称
    /// </summary>
    [Display(Name = "缴纳主体名称")]
    public string? PaymentName { get; set; }

    /// <summary>
    /// 缴纳主体社会统一信用代码
    /// </summary>
    [Display(Name = "缴纳主体社会统一信用代码")]
    public string? PaymentCode { get; set; }

    /// <summary>
    /// 缴存类型（100：按预设比例缴存 101：免除保证金 102：减少保证金应交金额 103：缓缴保证金 104：增加保证金应缴金额）
    ///</summary>
    [Display(Name = "缴存类型")]
    public 缴存类型? DepositeType { get; set; }

    /// <summary>
    /// 应缴纳金额
    ///</summary>
    [Display(Name = "应缴纳金额")]
    public decimal? Payable { get; set; }

    /// <summary>
    /// 已缴纳金额/担保金额/保单金额
    ///</summary>
    [Display(Name = "已缴纳金额")]
    public decimal? Paid { get; set; }

    /// <summary>
    /// 差异化缴存金额（应缴纳金额和已缴纳金额的差值，取正值）
    ///</summary>
    [Display(Name = "差异化缴存金额")]
    public decimal? Difference { get; set; }

    /// <summary>
    /// 缴存起始日期/有效期起始起始日期
    ///</summary>
    [Display(Name = "缴存起始日期")]
    public DateTime? StartDate { get; set; }

    /// <summary>
    /// 有效期终止日期
    ///</summary>
    [Display(Name = "有效期终止日期")]
    public DateTime? EndDate { get; set; }

    /// <summary>
    /// 工程担保保函函号/保险单号
    ///</summary>
    [Display(Name = "工程担保保函函号")]
    public string? GuaranteeLetterNo { get; set; }

    /// <summary>
    /// 保函凭证
    /// </summary>
    [Display(Name = "保函凭证")]
    public IEnumerable<AttachmentsForm<int>> Attachments { get; set; }
}

/// <summary>
/// 保证金缴纳信息审核表单
/// </summary>
public class ProjectGuaranteePaymentAuditForm
{
    [Display(Name = "id")]
    public int Id { get; set; }

    /// <summary>
    /// 保证金状态
    ///</summary>
    [Display(Name = "保证金状态")]
    [Required(ErrorMessage = "{0}不能为空")]
    public 保证金状态 Status { get; set; }

    /// <summary>
    /// 审核意见
    /// </summary>
    [Display(Name = "审核意见")]
    [Required(ErrorMessage = "{0}审核意见")]
    public string? CheckReason { get; set; }
}